package easy;

public class Solution_1961 {

    public boolean isPrefixString(String s, String[] words) {
        int index = 0;
        for (int i = 0; i < words.length; i++) {
            if (index + words[i].length() > s.length()) {
                return false;
            }
            for (int j = 0; j < words[i].length(); j++) {
                if (index == s.length() || words[i].charAt(j) != s.charAt(index++)) {
                    return false;
                }
            }
            if (index == s.length()) {
                return true;
            }
        }
        return index == s.length();
    }

    public static void main(String[] args) {
        Solution_1961 model = new Solution_1961();
    }
}
